//
//  PicCardView.m
//  UPai
//
//  Created by zhan ky on 11-10-9.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "PicCardView.h"


@implementation PicCardView
@synthesize BigImg, SmallImg, CurIndex;
@synthesize delegate;


- (id)init
{
	if (self=[super init]) {
		
		self.frame = CGRectMake(0, 0, PIC_FRAME, PIC_FRAME);
		self.BigImg = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, PIC_FRAME, PIC_FRAME)];
		self.BigImg.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleBottomMargin ;
		self.SmallImg = [[UIImageView alloc] initWithFrame:CGRectMake(50, 50, 20, 20)];
		self.SmallImg.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleBottomMargin ;
		[self addSubview:BigImg];
		[self addSubview:SmallImg];
	}
	
	return self;
}

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
	
	[delegate DidSelectPic:self];
}

- (void)awakeFromNib
{
	self.backgroundColor = [UIColor colorWithRed:1.0f green:1.0f blue:1.0f alpha:0.0f];
}



- (void)dealloc {
	[BigImg release];
	BigImg = nil;
	[SmallImg release];
	SmallImg = nil;
	
    [super dealloc];
}

@end
